package com.yiyuan.app.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.guaike.core.entity.enums.EnableStatusEnum;
import com.guaike.core.mybatis.plugins.BaseDAO;
import com.yiyuan.app.entity.po.MProductLookPO;
import com.yiyuan.app.mapper.MProductLookMapper;
import org.springframework.stereotype.Repository;

@Repository
public class MProductLookDAO extends BaseDAO<MProductLookMapper, MProductLookPO> {

    public MProductLookPO findEnableOne(Integer productType) {
        LambdaQueryWrapper<MProductLookPO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(MProductLookPO::getProductType, productType);
        queryWrapper.eq(MProductLookPO::getStatus, EnableStatusEnum.ENABLE.getCode());
        return getBaseMapper().selectOne(queryWrapper);
    }
}
